<?php
namespace app\index\controller;

use app\base\BaseController;
use app\base\model\Article;
use think\Request;

class Index extends BaseController
{
    public function index()
    {
        $request = Request::instance();
        $page = $request->has('page') ? $request->param('page') : 1;
        $limit = 5;
        $offset = $limit * $page-$limit;
        $article = new Article();
        $this->assign('page', $page);
        $this->assign('article_list',$article->limit($offset,$limit)->select());
        $this->assign('article_count',$article->count('articid'));
        return $this->fetch();
    }
}
